{extend name="$base" /}
{block name="resources"}
<script type="text/javascript" src="__STATIC__/My97DatePicker/WdatePicker.js"></script>
<link href="__STATIC__/blue/css/order/ns_orderlist.css" rel="stylesheet" type="text/css" />
<style>
.mytable.select td{padding-bottom:0;}
.table-class tbody td a {margin-left: 0;color: #5e6166;}
.to-fixed{position: fixed;width: 85.5%;top: 50px;box-shadow: 0 2px 6px 0 rgba(0,0,0,.3);z-index: 5;}
.mytable td{padding:10px 0;}
.btn-common-white{line-height: 20px;outline: none;background: white}
.ns-main{margin-top: 0;}
.seller_memo{background: #FFF9DF!important;color: #D09B4C;}
.ns-third-menu{margin: 10px 10px 0 0px;}
</style>
{/block}
{block name="main"}
<input type="hidden" id="order_id" />
<input type="hidden" id="print_select_ids" />
<input type="hidden" id="hidden_order_status" value="{$status}" />
<input type="hidden" id="hidden_member_id" value="{$member_id}" >
<div>
	<nav class="ns-third-menu js-order-status-menu">
		<ul id="order_status_nav">
			<li {if condition="$status==''"}class="selected"{/if}" onclick="location.href='{if $order_type == ""}{:__URL("ADMIN_MAIN/order/orderlist",'')}{else/}{:__URL("ADMIN_MAIN/order/orderlist",'order_type='.$order_type)}{/if}'">全部</li>
			{notempty name="$order_status"}
			{foreach name="$order_status" item="vo"}
			<li {if condition="$status==$vo['status_id']"}class="selected"{/if} onclick="location.href='{if $order_type == ""}{:__URL("ADMIN_MAIN/order/orderlist",'status='.$vo['status_id'])}{else/}{:__URL("ADMIN_MAIN/order/orderlist",'status='.$vo['status_id'].'&order_type='.$order_type)}{/if}'">{$vo['status_name']}</li>
			{/foreach}
			{/notempty}
		</ul>
	</nav>
	
	<table class="mytable select">
	<tr>
		<th align="left">
			
			<a class="btn-common-white" id="PrintOrder" href="javascript:;">
				<i class="fa fa-print"></i>
				<span>打印订单</span>
			</a>
			{if condition="$status neq '' && $status neq 0 "}
			{if condition="$status eq 1"}
			<a class="btn-common-white" id="BatchShipment" href="javascript:;">
				<span>批量发货</span>
			</a>
			{/if}
			{in name="$status" value="1,2"}
			<a class="btn-common-white" id="PrintShipping" href="javascript:;">
				<i class="fa fa-print"></i>
				<span>打印出库单</span>
			</a>
			<a class="btn-common-white" id="BatchPrint" href="javascript:;">
				<i class="fa fa-print"></i>
				<span>批量打印快递单</span>
			</a>
			<a class="btn-common-white" id="BatchPrintinvoice" href="javascript:;">
				<i class="fa fa-print"></i>
				<span>批量打印发货单</span>
			</a>
			{/in}
			{if condition="$status eq 5 "}
			<a class="btn-common-white" href="javascript:batchDelete();">
				<i class="fa fa-trash"></i>
				<span>批量删除</span>
			</a>
			{/if}
			{/if}
		</th>
		<th style="position: relative;" class="default-condition default-yundan-condition">
			<input id="orderNo" class="input-common middle" type="text" placeholder="请输入订单编号"/>
			<button onclick="LoadingInfo(1)" class="btn-common">搜索</button>
			<button onclick="openSeniorSearch('.default-condition')" value="搜索" class="btn-common" >高级搜索</button>
			<button onclick="dataExcel()" class="btn-common">导出数据</button>
			<!--========20191023  导入运单号 by ——HZB   begin ==================================-->
			<!--<button onclick="openYunDan('.default-yundan-condition')" value="导入" class="btn-common">导入运单号</button>-->
			<!--========20191023  导入运单号 by ——HZB   end ==================================-->
		</th>
	</tr>
</table>

<!-- 高级搜索 -->
<div class="nui-condition">
	<div class="c-item-column">
		<label for="orderNo">订单编号：</label>
		<input id="orderNo" class="input-common middle" type="text" placeholder="请输入订单编号"/>
	</div>
	<div class="c-item-column">
		<label for="payment_type">支付方式：</label>
		<select id="payment_type" class="select-common middle">
			<option value="">全部</option>
			<option value="1">微信</option>
			<option value="2">支付宝</option>
			<option value="10">线下支付</option>
			<option value="4">货到付款</option>
		</select>
	</div>
	<div class="c-item-column">
		<label for="shipping_type">配送方式：</label>
		<select id="shipping_type" class="select-common middle">
			<option value="">全部</option>
			<option value="1">物流配送</option>
			<option value="2">买家自提</option>
			<option value="3">本地配送</option>
		</select>
	</div>
	
	<div class="c-item-column">
		<label for="order_type">订单类型：</label>
		<select id="order_type" class="select-common middle">
			<option value="" {if empty($order_type)} selected{/if}>全部</option>
			{foreach $order_type_list as $k => $v}	
				<option value="{$v.id}" {if $order_type == $v['id']} selected{/if}>{$v.name}</option>
			{/foreach}
		</select>
	</div>
	
	<div class="c-item-column">
		<label for="order_status">订单状态：</label>
		<select id="order_status" class="select-common middle">
			<option value="">全部</option>
			{notempty name="$order_status"}
			{foreach name="$order_status" item="vo"}
			<option value="{$vo['status_id']}">{$vo['status_name']}</option>
			{/foreach}
			{/notempty}
		</select>
	</div>
	
	<div class="c-item-column">
		<label for="startDate">下单时间：</label>
		<input type="text" id="startDate" class="input-common middle" placeholder="请选择开始日期" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
		&nbsp;-&nbsp;
		<input type="text" id="endDate" placeholder="请选择结束日期" class="input-common middle" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
	</div>
	<br />
	
	<div class="c-item-column">
		<label for="userName">收货人姓名：</label>
		<input id="userName" class="input-common middle" type="text" placeholder="请输入收货人姓名" />
	</div>
	<div class="c-item-column">
		<label for="receiverMobile">收货人手机号：</label>
		<input id="receiverMobile" class="input-common middle" type="text" placeholder="请输入收货人手机号" />
	</div>
	
	<br />
	
	<div class="c-operation">
		<button onclick="LoadingInfo(1)"  value="搜索" class="btn-common" >搜索</button>
		<button onclick="dataExcel()"  value="导出" class="btn-common-white" >导出数据</button>
		<a href="javascript:clearCondition();">清空筛选条件</a>
	</div>
	<a href="javascript:retractSeniorSearch();" class="retract">收起↑</a>
</div>

	<!--导入运单号   20191028   by —— HZB  =============================================  begin -->
	<!--<div class="yundan-condition">-->
		<!--<div class="c-item-column">-->
			<!--<a class="btn" style="margin-bottom:6px;">导入Excel-->
				<!--<div style="filter:alpha(opacity=0);cursor: pointer; opacity: 0; position: absolute;  width: 75px;margin: -18px 0 0 -6px ;margin: -16px 0 0 -6px\9;height:20px\9;overflow: hidden; ">-->
					<!--<input type="file" id="txtFile" onchange="fileUpload_excel()" name="upload" style="font-size: 200px;cursor: pointer;direction: rtl ！important; float: right\9; "/>-->
				<!--</div>-->
			<!--</a>-->

		<!--</div>-->
		<!--<div class="c-operation">-->
			<!--<a href="javascript:clearYunDan();">清空导入文件</a>-->
		<!--</div>-->
		<!--<a href="javascript:retractYunDan();" class="retract">收起↑</a>-->
	<!--</div>-->
	<!--导入运单号   20191028   by —— HZB  =============================================  end -->

	<table class="table-class" id="ajax-orderlist">
		<colgroup>
			<col width="2%">
			<col width="31%">
			<col width="10%">
			<col width="10%">
			<col width="10%">
			<col width="6%">
			<col width="7%">
			<col width="7%">
			<col width="7%">
			<col width="10%">
		</colgroup>
		<thead>
			<tr align="center">
				<th>
					<i class="checkbox-common">
						<input type="checkbox"  id="check" />
					</i>
				</th>
				<th>商品信息</th>
				<th>商品清单</th>
				<th>订单金额</th>
				<th>收货信息</th>
				<th>买家</th>
				<th>交易状态</th>
				<th>配送方式</th>
				<th>订单类型</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody id="ajax-orderlist"></tbody>
	</table>
	
</div>

<div id="orderAction"></div>
{/block}
{block name="script"}
<script type="text/javascript">
var order_type = '{$order_type}';
var order_status_list = [];//订单状态列表
var is_first = true;
$(window).scroll(function(){
	var scrollTop = $(window).scrollTop();
	if(scrollTop > 140){
		$("nav.order-nav").addClass("to-fixed").css("width",$(".ns-main").width()-2);
	}else{
		$("nav.order-nav").removeClass("to-fixed").css("width","");
	}
});

$(function () {
	$("[data-toggle='popover']").popover();
	
	$("#order_type").change(function () {
		var order_type = $(this).val();
		$.ajax({
			type : "post",
			url : "{:__URL('ADMIN_MAIN/order/getOrderStatus')}",
			data : { order_type : order_type },
			success : function (res) {
				var option_html = "";
				if(res.code > 0){
					order_status_list = res["data"];
					option_html += '<option value="">全部</option>';
					$.each(res["data"], function(i, status_item){     
						option_html += '<option value="' + status_item.status_id + '">' + status_item.status_name + '</option>';
					}); 
				}
				$("#order_status").html(option_html);
				if(is_first){
					$("#order_status").val($("#hidden_order_status").val());
					is_first = false;
				}
				
				//公共下拉框
				$('.select-common').selectric();
			}
		});
	});

	$("#order_type").change();
});

var is_load_orderaction = 0;
function LoadingInfo(page_index) {
	var start_date = $("#startDate").val();
	var end_date = $("#endDate").val();
	var user_name = $("#userName").val();
	var order_no = $("#orderNo").val();
	var receiver_mobile = $("#receiverMobile").val();
	if(is_first){
		var order_status = $("#hidden_order_status").val();
		
	}else{
		var order_status = $("#order_status").val();
	}
	var payment_type = $("#payment_type").val();
	var order_type = $("#order_type").val();
	var shipping_type = $("#shipping_type").val();
	var member_id = $("#hidden_member_id").val();
	
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/order/orderlist')}",
		data : {
			"page_index" : page_index,
			"page_size" : $("#showNumber").val(),
			"start_date" : start_date,
			"end_date" : end_date,
			"user_name" : user_name,
			"order_no" : order_no,
			"order_status" : order_status,
			"receiver_mobile" : receiver_mobile,
			"payment_type" : payment_type,
			"shipping_type" : shipping_type,
			"order_type" : order_type,
			"tuangou_group_id" : "{$tuangou_group_id}",
			"member_id" : member_id,
		},
		success : function(data) {
			if (data["data"].length > 0) {

				$("#ajax-orderlist tbody").empty();
				for (var i = 0; i < data["data"].length; i++) {
					var html = '';
					var out_trade_no = data["data"][i]["out_trade_no"];//交易号
					var order_id = data["data"][i]["order_id"];//订单id
					var order_no = data["data"][i]["order_no"];//订单编号
					var create_time = timeStampTurnTime(data["data"][i]["create_time"]);//下单时间
					var pic_cover_micro = data["data"][i]["order_item_list"][0]["picture"]['pic_cover_micro'];//商品图
					
					var goods_id = data["data"][i]["order_item_list"][0]["goods_id"];//商品id
					var goods_name = data["data"][i]["order_item_list"][0]["goods_name"];
					var sku_name = data["data"][i]["order_item_list"][0]["sku_name"];//商品sku
					var price = data["data"][i]["order_item_list"][0]["price"];//商品价格
					var num = data["data"][i]["order_item_list"][0]["num"];//购买数量
					var order_money = data["data"][i]["order_money"];//订单金额
					var shipping_money = data["data"][i]["shipping_money"];//运费
					var pay_money = data["data"][i]["pay_money"];//运费
					var seller_memo = data["data"][i]["seller_memo"];//订单备注
					var goods_code = data["data"][i]["order_item_list"][0]["code"];
					var gift_flag = data['data'][i]['order_item_list'][0]['gift_flag'];//赠品标识，0：不是赠品，1：是赠品
					var shipping_type_name = data['data'][i]['shipping_type_name'];//配送方式
					var order_type = data['data'][i]['order_type'];
					var order_type_name = data['data'][i]['order_type_name'];

					var row=1;//订单数量，用于设置跨行
					if(data["data"][i]["order_item_list"].length!=null) {
						row = data["data"][i]["order_item_list"].length;
					}

					html += '<tr>';
					
						html += '<td rowspan="'+row+'"><i class="checkbox-common"><input id="'+out_trade_no+'" type="checkbox"  value="'+order_id+'" name="sub"></i></td>';
						
						html += '<td>';
						
							html += '<div style="font-size: 12px;margin-bottom:5px;">';
								html +='<span>订单编号：'+order_no+'</span>&nbsp;<span>下单时间：'+create_time+'</span>';
							html += '</div>';
						
							html += '<div class="product-img"><img src="'+__IMG(pic_cover_micro)+'"></div>';
							html += '<div class="product-infor">';
								html += '<a href="'+__URL('SHOP_MAIN/goods/detail?goods_id='+goods_id)+'" target="_blank" >'+goods_name+'</a>';
								if(sku_name != null && sku_name != "") {
									html += '<p class="specification" style="margin-bottom: 0px;"><span style="color:#8e8c8c;font-size:12px;">' + sku_name + '</span></p>';
								}
								if(goods_code != null && goods_code != "") {
									html += '<p class="specification"><span style="color:#8e8c8c;font-size:12px;">编码&nbsp;&nbsp;' + goods_code + '</span></p>';
								}
							
								//添加赠品标识
								if(gift_flag > 0) {
									html += '<i style="font-size:12px;margin:5px 5px 0 0;padding:1px 4px;border-radius:3px;display:inline-block;color:#FFF;background-color:#FF6600;height:16px;line-height: 16px;overflow:hidden;font-style:normal;">赠品</i>';
								}
						
							html += '</div>';
						html += '</td>';
						
						//订单数量大于1个，调整样式
						html += '<td>';
							html += '<div class="cell" style="display: inline-block;"><span>'+price+'元</span></div>';
							html += '<div class="cell" style="display: inline-block;float:right;">'+num+'件</div>';
						
							//调价
							if(data["data"][i]["order_item_list"][0]['adjust_money'] != 0){
								var adjust_money = data["data"][i]["order_item_list"][0]["adjust_money"];//调教
								html += '<div class="cell" style="display: inline-block;"><span>(调价：'+adjust_money+'元)</span></div>';
							}
							
							if(	data["data"][i]["order_item_list"][0]['refund_status'] != 0) {
								//退款
								var order_goods_id = data["data"][i]["order_item_list"][0]["order_goods_id"];//订单项id
								var status_name = data["data"][i]["order_item_list"][0]["status_name"];//状态
								//订单数量大于1个，调整样式
								if (data["data"][i]["order_item_list"].length > 1) {
									html += '<a href="' + __URL('ADMIN_MAIN/order/orderrefunddetail?itemid=' + order_goods_id) + '" style="margin:5px 0 10px 0;display:block;text-align:center;">' + status_name + '</a>';
								} else {
									html += '<a href="' + __URL('ADMIN_MAIN/order/orderrefunddetail?itemid=' + order_goods_id) + '" style="margin:5px 0 10px 0;display:block;">' + status_name + '</a>';
								}
								for (var m = 0; m < data["data"][i]["order_item_list"][0]["refund_operation"].length; m++) {
									var operation_type = data["data"][i]["order_item_list"][0]["refund_operation"][m]['no'];//选项类型
									var color = data["data"][i]["order_item_list"][0]["refund_operation"][m]['color'];
									var order_goods_id = data["data"][i]["order_item_list"][0]['order_goods_id'];//订单项id
									var refund_require_money = data["data"][i]['order_item_list'][0]["refund_require_money"];//退款金额
									var name = data["data"][i]["order_item_list"][0]["refund_operation"][m]['name'];//退款状态
									html += '<a style="display:block;margin-bottom:5px;color:' + color + ';text-align:center;" href="javascript:refundOperation(\'' + operation_type + '\',' + order_id + ',' + order_goods_id + ',' + refund_require_money + ')">' + name + '</a>';
								}
							}
						html += '</td>';
						
						html += '<td rowspan="'+row+'" style="text-align:center">';
							html += '<div class="cell">';
								html += '<b class="netprice" style="color: #FF6600;font-size: 14px;font-weight: normal;">'+order_money+'</b><br/>';
								html += '<span class="expressfee">(需支付:' + pay_money + '元)</span><br/>';
								//虚拟商品不显示运费
								if(order_type != 2) {
									html += '<span class="expressfee">(含配送费:' + shipping_money + '元)</span><br/>';
								}
								html += '<span class="expressfee">'+data["data"][i]["pay_type_name"]+'</span>';
							html += '</div>';
						html += '</td>';
						
						//收货信息
						html += '<td rowspan="'+row+'" style="text-align:center">';
							var address = data["data"][i]["receiver_address"];
							html += '<div style="text-align:left;">';
								html += '<span class="expressfee">'+data["data"][i]["receiver_name"]+'</span><br/><span class="expressfee">'+data["data"][i]["receiver_mobile"]+'</span>';
								if(data["data"][i]["fixed_telephone"] != "") {
									html += '<br><span>' + data["data"][i]["fixed_telephone"] + '</span>';
								}
								html += '<br/><span class="expressfee">'+address+'</span>';
							html += '</div>';
						html += '</td>';
						
						//买家信息
						html += '<td rowspan="'+row+'" style="text-align:center">';
							html += '<div class="cell"><a href="'+__URL('ADMIN_MAIN/member/memberdetail?member_id='+ data['data'][i]['buyer_id'])+'" class = "skip">'+data["data"][i]["user_name"]+'</a><br/>';
							html += '<i class="'+data["data"][i]["order_from_tag"]+'" style="color:#666;"><i></div>';
						html += '</td>';
						
						//交易状态
						html += '<td rowspan="'+row+'"><div class="business-status" style="text-align:center">'+data["data"][i]["status_name"]+'<br></div></td>';
						
						//配送方式，虚拟商品没有
						html += '<td rowspan="'+row+'"><div class="business-status" style="text-align:center">'+ shipping_type_name +'<br></div></td>';
					
						html += '<td rowspan="'+row+'"><div class="business-status" style="text-align:center">'+ order_type_name +'<br></div></td>';
						
						html += '<td rowspan="'+row+'" style="text-align:center;">';
						
							if(order_type == '7'){
								html += '<a style="display:block;margin-bottom:5px;color:#00A0DE;" href="'+__URL('ADMIN_MAIN/order/bargainOrderDetail?order_id='+order_id)+'">订单详情</a>';
							}else{
								html += '<a style="display:block;margin-bottom:5px;color:#00A0DE;" href="'+__URL('ADMIN_MAIN/order/orderdetail?order_id='+order_id)+'">订单详情</a>';
							}
	
							if(data["data"][i]["operation"] != ''){
								for(var m = 0; m < data["data"][i]["operation"].length; m++){
									if(data["data"][i]["operation"][m]['no'] == "seller_memo"){
										html += '<a style="display:block;margin-bottom:5px;color:'+data["data"][i]["operation"][m]["color"]+'" href="javascript:operation(\''+data["data"][i]["operation"][m]['no']+'\','+data["data"][i]["order_id"]+','+ data['data'][i]['buyer_id'] + ')" >'+data["data"][i]["operation"][m]['name']+'</a>';
									}else{
										html += '<a style="display:block;margin-bottom:5px;color:'+data["data"][i]["operation"][m]["color"]+'" href="javascript:operation(\''+data["data"][i]["operation"][m]['no']+'\','+data["data"][i]["order_id"]+',' + data['data'][i]['buyer_id'] + ')" >'+data["data"][i]["operation"][m]['name']+'</a>';
									}
								}
							}
						html += '</td>';
					html += '</tr>';
					
					//循环订单项，前边已经加载过一次了，所以从第二次开始循环
					for(var j = 1; j < data["data"][i]["order_item_list"].length; j++){
						var pic_cover_micro = data["data"][i]["order_item_list"][j]["picture"]['pic_cover_micro'];//商品图
						var goods_id = data["data"][i]["order_item_list"][j]["goods_id"];//商品id
						var goods_name = data["data"][i]["order_item_list"][j]["goods_name"];//商品名称
						var sku_name = data["data"][i]["order_item_list"][j]["sku_name"];//sku名称
						var price = data["data"][i]["order_item_list"][j]["price"];//价格
						var num = data["data"][i]["order_item_list"][j]["num"];//购买数量
						var gift_flag = data["data"][i]["order_item_list"][j]["gift_flag"];//赠品标识，0：不是赠品，1：是赠品
						
						var goods_code = data["data"][i]["order_item_list"][j]["code"];
						html += '<tr class="js-child-order">';
						html += '<td colspan="1">';
						html += '<div class="product-img"><img src="'+__IMG(pic_cover_micro)+'"></div>';
						html += '<div class="product-infor">';
						html += '<a class="name" href="'+__URL('SHOP_MAIN/goods/detail?goods_id='+goods_id)+'" target="_blank" >'+goods_name+'</a>';
						if(sku_name != null && sku_name != ''){
							html += '<p class="specification" style="margin-bottom: 0px;"><span style="color:#8e8c8c;font-size:12px;">'+sku_name+'</span></p>';
						}
						if(goods_code != null && goods_code != ''){
							html += '<p class="specification"><span style="color:#8e8c8c;font-size:12px;">'+goods_code+'</span></p>';
						}
						
						//添加赠品标识
						if(gift_flag > 0){
							html += '<i style="font-size:12px;margin:5px 5px 0 0;padding:1px 4px;border-radius:3px;display:inline-block;color:#FFF;background-color:#FF6600;height:16px;line-height: 16px;overflow:hidden;font-style:normal;">赠品</i>';
						}
						html += '</div></td>';

						//只给中间的商品加
						if((j+1) != data["data"][i]["order_item_list"].length){
							html += '<td style="border-left:0px solid #fff;border-bottom:1px solid #e5e5e5;">';//商品信息与商品清单的分割线
						}else{
							html += '<td style="border-left:0px solid #fff;">';//商品信息与商品清单的分割线
						}

						//添加赠品标识
						html += '<div class="cell" style="display: inline-block;"><span>'+price+'元</span></div>';
						html += '<div class="cell" style="display: inline-block;float:right">'+num+'件</div>';
						//调价
						if(data["data"][i]["order_item_list"][j]['adjust_money'] != 0){
							var adjust_money = data["data"][i]["order_item_list"][j]["adjust_money"];
							html += '<div class="cell" style="display: inline-block;"><span>(调价：'+adjust_money+'元)</span></div>';
						}
						if(data["data"][i]["order_item_list"][j]['refund_status'] != 0){
							//退款
							var order_goods_id = data["data"][i]["order_item_list"][j]["order_goods_id"];//订单项id
							var status_name = data["data"][i]["order_item_list"][j]["status_name"];//订单状态
							
							html +='<br><a href="'+__URL('ADMIN_MAIN/order/orderrefunddetail?itemid='+order_goods_id)+'" style="margin:5px 0 5px 0;display:block;text-align:center;">'+status_name+'</a>';
							
							for(var m = 0; m < data["data"][i]["order_item_list"][j]["refund_operation"].length; m++){
								var operation_type = data["data"][i]["order_item_list"][j]["refund_operation"][m]['no'];//选项类型
								var color = data["data"][i]["order_item_list"][j]["refund_operation"][m]['color'];
								var order_goods_id = data["data"][i]["order_item_list"][j]['order_goods_id'];//订单项id
								var refund_require_money = data["data"][i]['order_item_list'][j]["refund_require_money"];//退款金额
								var name = data["data"][i]["order_item_list"][j]["refund_operation"][m]['name'];//退款状态
								html += '<a style="display:block;margin-bottom:5px;color:'+color+';text-align:center;" href="javascript:refundOperation(\''+operation_type+'\','+order_id+','+order_goods_id+','+refund_require_money+')" >'+name+'</a>';
							}
						}
						html += '</td>';
						html += '</tr>';
					}
					if(seller_memo.length > 0){
						html += '<tr><td colspan="10" class="seller_memo">卖家备注：'+seller_memo+'</td></tr>';
					}
					if(i < data["data"].length - 1){
						html += '<tr style="height:10px;"><td style="border-bottom:solid #E1E6F0;border-width:0 0 1px 0;" colspan="10"></td></tr>';
					}
					$("#ajax-orderlist tbody").append(html);
				}
			} else {
				var html = '<tr align="center"><td colspan="10">暂无符合条件的订单</td></tr>';
				$("#ajax-orderlist tbody").html(html);
			}

			if(is_load_orderaction == 0){
				var action = "";
				$.each(data["action"], function(i, n){
					action += n; 
				});
				$("#orderAction").append(action);
				is_load_orderaction = 1;
			}
			
			initPageData(data["page_count"],data['data'].length,data['total_count']);
			$("#pageNumber").html(pagenumShow(jumpNumber,$("#page_count").val(),{$pageshow}));
		}
	});
}

function addmemo(order_id,memo){
	$("#order_id").val(order_id);
	$("#memo").val(memo);
	$("#Memobox").modal("show");
}
/**
 * 订单数据导出
 */
function dataExcel(){
	var start_date = $("#startDate").val();
	var end_date = $("#endDate").val();
	var user_name = $("#userName").val();
	var order_no = $("#orderNo").val();
	var receiver_mobile = $("#receiverMobile").val();
	var order_status = $("#order_status").val();
	var payment_type = $("#payment_type").val();
	var order_type = $("#order_type").val();
	var order_ids= [];
	$(".table-class tbody input[type = 'checkbox']:checked").each(function() {
		if (!isNaN($(this).val())) {
			order_ids.push($(this).val());
		}
	});
	window.location.href=__URL("ADMIN_MAIN/order/orderDataExcel?start_date="+start_date+"&end_date="+end_date+"&user_name="+user_name+"&order_no="+order_no+"&order_status="+order_status+"&receiver_mobile="+receiver_mobile+"&payment_type="+payment_type+"&order_ids="+order_ids.toString() + "&order_type=" + order_type);
}

/**
* 批量删除已关闭订单
*/
function batchDelete(){
	var order_ids= [];
	$(".table-class tbody input[type = 'checkbox']:checked").each(function() {
		if (!isNaN($(this).val())) {
			order_ids.push($(this).val());
		}
	});
	if(order_ids.length ==0){
		$( "#dialog" ).dialog({
			buttons: {
				"确定,#0059d6,#fff": function() {
					$(this).dialog('close');
				}
			},
			contentText:"请选择需要操作的记录",
			title:"消息提醒",
		});
		return false;
	}
	delete_order(order_ids);
}

// 点击显示更多搜索
$(".more-search").on("click", function(e){
	$(".more-search-container").slideToggle();
	$(document).one("click", function(){
		$(".more-search-container").slideUp();
	});
	e.stopPropagation();
});

$(".more-search-container").on("click", function(e){
	e.stopPropagation();
});

/**
 * 文件上传（excel） added by HZB 20191028 =============================================== begin
 */
//function fileUpload_excel(event) {
//	var fileid = $(event).attr("id");
//	var dom = document.getElementById(fileid);
//	var file =  dom.files[0];//File对象;
//	var fileTypeArr = ['xls','xlsx'];
//	var flag = false;
//	if(file != null){
//		for(var i=0;i<fileTypeArr.length;i++){
//			if(file.type == fileTypeArr[i]){
//				flag = true;
//				break;
//			}
//		}
//	}
//	if(!flag){
//		showTip("文件类型不合法，请上传.xls文件或.xlsx文件","warning");
//	}else{
//		var data = { 'file_path' : "goods_video" };
//		uploadFile({
//			url: __URL(ADMINMAIN + '/goods/uploadvideo'),
//			fileId: fileid,
//			data : data,
//			callBack: function (res) {
//				if(res.code){
//					$("#video_url").val(res.data.path);
//					$(".del-video").show();
//					var xls = "my-xls";
//					var myPlayer = videojs(xls);
//					var xlsUrl = __IMG(res.data.path);
//
//					videojs(xls).ready(function(){
//
//						var myPlayer = this;
//						myPlayer.src(xlsUrl);
//						myPlayer.load(xlsUrl);
//						myPlayer.play();
//
//					});
//
//					showTip(res.message,"success");
//				}else{
//					showTip(res.message,"error");
//				}
//			}
//		});
//	}
//}
/**
 * 文件上传（excel） added by HZB 20191029 =============================================== end
 */

</script>
{/block}